package com.dongzhu1428.express.Util;

import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Arrays;
import java.util.List;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class KeyValue {
    String key;
    Object value;
  public   List<String> getList(){
         if(value.getClass().equals(com.alibaba.fastjson.JSONArray.class)){
              return JSONObject.parseArray(value.toString(),String.class);
         }

         else return Arrays.asList(value.toString());
    }

}
